import { _decorator } from 'cc';
import { BaseConfig } from '../base/BaseConfig';
const { ccclass, property } = _decorator;


@ccclass('CfgLanguage')
export class CfgLanguage extends BaseConfig<ILanguageItem> {
    //这里单纯的根据key和语言类型返回对应的文本
    getText(key: string, lang: LANTYPE) {    
        const e = this.datas.find(e=>e.name==key)
        return e[lang];
    }
}

export interface ILanguageItem {
    name: string,
    zh_cn: string
    en: string,
    zh_tw: string
}

export type LANTYPE = "zh_cn" | "en" | "zh_tw";